﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Netfraction.Network.Protocol.BASE.Handler
{
    public class HandlerSCH : ProtocolMessageActionHandler
    {
        public HandlerSCH()
            : base()
        {
            mParameterCodes = new List<string>(new string[] { "AN", "NO", "EX", "LE", "GE", "EQ", "TO", "TY" });

            mSupportedConnectionStates = new List<RemoteMachine.ConnectionState>();
        }

        #region ProtocolMessageActionHandler Members

        public override string ProtocolActionCode
        {
            get { return "SCH"; }
        }

        public override bool HandleProtocolMessage(Netfraction.RemoteMachine.Node node, ProtocolMessage message, IEnumerable<ProtocolFeature> extenders)
        {
            Console.WriteLine("in SCH handler");
            if (message.Parameters.Count != 0)
            {
                message.Parameters = DecodeParameters(message.Parameters);
                //(node as RemoteMachine.Hub).SessionId = message.GETParameterOptions[0].ParameterValue;
                return true;
            }
            return false;
        }

        #endregion
    }
}
